package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._0._0封装;

/**
 * @ClassName Cat
 * @Description TODO
 * @Author zero
 * @DATE 2023/7/9 6:56 PM
 * @Version 1.0
 */
public class Cat {
    private String name;

    private int shoutNum = 3;

    public Cat(String name) {
        this.name = name;
    }

    public Cat() {
        this.name = "无名";
    }

    public void setShoutNum(int value) {
        this.shoutNum = value;
    }

    public int getShoutNum() {
        return this.shoutNum;
    }

    public String shout() {
        String result = "";
        for (int i = 0; i < this.shoutNum; i++) {
            result += "喵 ";
        }
        return "我的名字叫" + name + " " + result;
    }

}
